package com.example.bbs.bean;

import android.os.Parcel;
import android.os.Parcelable;

public class SearchHistory implements Parcelable{

    String searchText;
    long time;

    public SearchHistory() {}

    public SearchHistory(String searchText, long time) {
        this.searchText = searchText;
        this.time = time;
    }

    public String getSearchText() {
        return searchText;
    }

    public void setSearchText(String searchText) {
        this.searchText = searchText;
    }

    public long getTime() {
        return time;
    }

    public void setTime(long time) {
        this.time = time;
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(searchText);
        dest.writeLong(time);
    }

    public static final Parcelable.Creator<SearchHistory> CREATOR = new Parcelable.Creator<SearchHistory>() {
        @Override
        public SearchHistory createFromParcel(Parcel source) {
            return new SearchHistory(source.readString(), source.readLong());
        }

        @Override
        public SearchHistory[] newArray(int size) {
            return new SearchHistory[size];
        }
    };
}
